<template>
  <div>
    <h1>我是子组件</h1>
    <button @click="senF">向父组件传参</button>
    {{ X }}
  </div>
</template>

<script setup>
import {
  ref,
  reactive,
  toRefs,
  onBeforeMount,
  onMounted,
  watchEffect,
  computed,
  inject,
} from "vue";
let X = inject("sendChild",ref(""));
const senF = ()=>{
  X.value = "11111";
}
</script>
<style scoped>
</style>